package fr.afcepf.ai89.esharing.tests;

import java.util.ArrayList;
import java.util.List;

import fr.afcepf.ai89.esharing.entity.CategorieAem;
import fr.afcepf.ai89.esharing.entity.Civilite;
import fr.afcepf.ai89.esharing.entity.Complement;
import fr.afcepf.ai89.esharing.entity.FrCommune;
import fr.afcepf.ai89.esharing.entity.FrCommunePK;
import fr.afcepf.ai89.esharing.entity.FrDepartement;
import fr.afcepf.ai89.esharing.entity.FrRegion;
import fr.afcepf.ai89.esharing.entity.LibelleSousAvis;
import fr.afcepf.ai89.esharing.entity.Marque;
import fr.afcepf.ai89.esharing.entity.MotivationAnnulation;
import fr.afcepf.ai89.esharing.entity.MotivationRefus;
import fr.afcepf.ai89.esharing.entity.NoteAvis;
import fr.afcepf.ai89.esharing.entity.TypeAem;
import fr.afcepf.ai89.esharing.metier.BusinessApprovisionnerCriteres;
import fr.afcepf.ai89.esharing.metier.IBusinessApprovisionnerCriteres;

public class BusinessApprovisionnerCriteresTest {
	
	public static void main(String[] args) {
		
		IBusinessApprovisionnerCriteres busApproCrits = new BusinessApprovisionnerCriteres();
		
		/*
		
		List<FrRegion> lesRegions = new ArrayList<FrRegion>();
		
		lesRegions = busApproCrits.getRegions();
		
		for (FrRegion r : lesRegions) {
			
			System.out.println(String.valueOf(r.getIdRegion()) + " " + r.getNomRegion());
			
		}
		
		*/
		
		/*
		
		List<FrDepartement> lesDepts = new ArrayList<FrDepartement>();
		
		lesDepts = busApproCrits.getDepts();
		
		for (FrDepartement d : lesDepts) {
			
			System.out.println(String.valueOf(d.getIdDepartement()) + " " + d.getNomDepartement());
			
		}
		
		*/
		
		/*
		
		FrRegion r = new FrRegion();
		r.setIdRegion(11);

		List<FrDepartement> lesDepts = new ArrayList<FrDepartement>();
		
		lesDepts = busApproCrits.getDepts(r);
		
		for (FrDepartement d : lesDepts) {
			
			System.out.println(String.valueOf(d.getIdDepartement()) + " " + d.getNomDepartement());
			
		}
	
		*/
		
		/*
		
		FrDepartement d = new FrDepartement();
		d.setIdDepartement("75");
		
		List<FrCommune> lesCommunes = new ArrayList<FrCommune>();
		
		lesCommunes = busApproCrits.getCommunes(d);
		
		for (FrCommune c : lesCommunes) {
			
			System.out.print(c.getId().getIdDepartement() + " " + c.getId().getCodeCommune() + " " + c.getNomCommune());
			
			if (c.getEstPrefectureDept() == 1) {
				
				System.out.print(" - Préfecture");
				
			}
			
			System.out.println();
			
		}
		
		*/
		
		/*

		int cp = 51300;
		
		List<FrCommune> lesCommunes = new ArrayList<FrCommune>();
		
		lesCommunes = busApproCrits.getCommunes(cp);
		
		for (FrCommune c : lesCommunes) {
			
			System.out.println(c.getId().getIdDepartement() + " " + c.getId().getCodeCommune() + " " + c.getNomCommune());
						
		}
		
		*/
		
		/*
		
		FrCommune commune = new FrCommune();
		
			commune.setId(new FrCommunePK());
		
				commune.getId().setIdDepartement("75");
				commune.getId().setCodeCommune(56);
			
			commune.setFrDepartement(new FrDepartement());
			
				commune.getFrDepartement().setIdDepartement("75");
		
		List<Integer> codesPostaux = new ArrayList<Integer>();
		
		codesPostaux = busApproCrits.getCodesPostaux(commune);
		
		for (Integer cp : codesPostaux) {
			
			if (String.valueOf(cp).length() == 4) {
			
				System.out.print("0" + String.valueOf(cp));
				
			}
			
			System.out.println(String.valueOf(cp));
			
		}
		
		*/
		
		/*
		
		FrDepartement d = new FrDepartement();
		d.setIdDepartement("33");
	
		List<Integer> codesPostaux = new ArrayList<Integer>();
		
		codesPostaux = busApproCrits.getCodesPostaux(d);
		
		for (Integer cp : codesPostaux) {
			
			if (String.valueOf(cp).length() == 4) {
				
				System.out.print("0" + String.valueOf(cp));
				
			}
			
			System.out.println(String.valueOf(cp));
		
		}
		
		*/
		
		/*
		
		List<CategorieAem> cats = new ArrayList<CategorieAem>();
		
		cats = busApproCrits.getCategories();
		
		for (CategorieAem c : cats) {
			
			System.out.println(String.valueOf(c.getIdCategorieAem()) + " " + c.getNomCategorieAem());
			
		}
		
		*/
		
		/*
		
		List<CategorieAem> cats = new ArrayList<CategorieAem>();
		
		cats = busApproCrits.getMasterCategories();
		
		for (CategorieAem c : cats) {
			
			System.out.println(String.valueOf(c.getIdCategorieAem()) + " " + c.getNomCategorieAem());
			
		}
		
		*/
		
		/*
		
		CategorieAem cat = new CategorieAem();
		
		cat = busApproCrits.getCategorieAem(4);
		
		System.out.println(String.valueOf(cat.getIdCategorieAem()) + " " + cat.getNomCategorieAem());
		
		*/
		
		/*
		
		CategorieAem cat = new CategorieAem();
		
		cat = busApproCrits.getCategorieAem(4);
		
		List<CategorieAem> sousDeCat = new ArrayList<CategorieAem>();
		
		sousDeCat = busApproCrits.getSousCategories(cat);
		
		for (CategorieAem c : sousDeCat) {
			
			System.out.println(String.valueOf(c.getIdCategorieAem()) + " " + c.getNomCategorieAem());
			
		}
		
		*/
		
		/*
		
		CategorieAem cat = new CategorieAem();
		cat = busApproCrits.getCategorieAem(5);

		CategorieAem superChat = new CategorieAem();
		superChat = busApproCrits.getSuperCategorie(cat);
		
		System.out.println(String.valueOf(superChat.getIdCategorieAem()) + " " + superChat.getNomCategorieAem());
		
		*/
		
		/*
		
		List<TypeAem> types = new ArrayList<TypeAem>();
		types = busApproCrits.getTypesAem();
		
		for(TypeAem t : types) {
			
			System.out.println(String.valueOf(t.getIdTypeAem()) + " " + t.getTypeAem() + " in " + t.getCategorieAem().getNomCategorieAem());
			
		}
		
		*/
		
		/*
		
		CategorieAem cat = new CategorieAem();
		cat = busApproCrits.getCategorieAem(10);
		
		List<TypeAem> types = new ArrayList<TypeAem>();
		types = busApproCrits.getTypesAem(cat);
		
		for(TypeAem t : types) {
			
			System.out.println(String.valueOf(t.getIdTypeAem()) + " " + t.getTypeAem() + " in " + t.getCategorieAem().getNomCategorieAem());
			
		}
		
		*/
		
		/*
		
		TypeAem monType = new TypeAem();
		monType = busApproCrits.getType(4);
		
		System.out.println(String.valueOf(monType.getIdTypeAem()) + " " + monType.getTypeAem() + " in " + monType.getCategorieAem().getNomCategorieAem());
		
		List<Marque> lesMarques = new ArrayList<Marque>();
		
		lesMarques = busApproCrits.getMarques();
		
		for(Marque m : lesMarques) {
			
			System.out.println(String.valueOf(m.getIdMarque()) + " " + m.getMarque());
			
		}
		
		*/
		
		/*

		// Sept méthodes testées :
		
		List<Civilite> civs = new ArrayList<Civilite>();
		civs = busApproCrits.getCivilites();
		
		for(Civilite c : civs) {
			
			System.out.println(String.valueOf(c.getIdCivilite()) + " " + c.getCivilite());
			
		}
		
		System.out.println();
		
		List<Complement> comps = new ArrayList<Complement>();
		comps = busApproCrits.getComplements();
		
		for(Complement c : comps) {
			
			System.out.println(String.valueOf(c.getIdComplement()) + " " + c.getComplement());
			
		}
		
		System.out.println();
		
		List<NoteAvis> notesAv = new ArrayList<NoteAvis>();
		notesAv = busApproCrits.getNotesAvis();
		
		for(NoteAvis n : notesAv) {
			
			System.out.println(String.valueOf(n.getIdNote()) + " " + n.getValeurNote() + " " + n.getDescNote());
			
		}
		
		System.out.println();
		
		List<LibelleSousAvis> libsSousAv = new ArrayList<LibelleSousAvis>();
		libsSousAv = busApproCrits.getLibelleSousAvis();
		
		for(LibelleSousAvis l : libsSousAv) {
			
			System.out.println(String.valueOf(l.getIdLibelleSousAvis()) + " " + l.getLibelleSousAvis());
			
		}
		
		System.out.println();
		
		List<MotivationAnnulation> motsAnn = new ArrayList<MotivationAnnulation>();
		motsAnn = busApproCrits.getMotivsAnnul();
		
		for(MotivationAnnulation m : motsAnn) {
			
			System.out.println(String.valueOf(m.getIdMotivationAnnulation()) + " " + m.getChoixMotivationAnnulation());
			
		}
		
		System.out.println();
		
		List<MotivationRefus> motsRef = new ArrayList<MotivationRefus>();
		motsRef = busApproCrits.getMotivsRefus();
		
		for(MotivationRefus m : motsRef) {
			
			System.out.println(String.valueOf(m.getIdMotivationRefus()) + " " + m.getChoixMotivationRefus());
			
		}
		
		*/
		
		List<LibelleSousAvis> libsSousAvSurEmp = new ArrayList<LibelleSousAvis>();
		libsSousAvSurEmp = busApproCrits.getLibelleSousAvisSurEmprunteur();
		
		for(LibelleSousAvis l : libsSousAvSurEmp) {
			
			System.out.println(String.valueOf(l.getIdLibelleSousAvis()) + " " + l.getLibelleSousAvis());
			
		}
		
		System.out.println();
		
		List<LibelleSousAvis> libsSousAvSurPre = new ArrayList<LibelleSousAvis>();
		libsSousAvSurPre = busApproCrits.getLibelleSousAvisSurPreteur();
		
		for(LibelleSousAvis l : libsSousAvSurPre) {
			
			System.out.println(String.valueOf(l.getIdLibelleSousAvis()) + " " + l.getLibelleSousAvis());
			
		}
		

		
	}

}
